{include file="public/header"}
<style>
    #des{
        position: relative;
        z-index: 0;
    }
</style>
<form class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px 20px 20px 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">商品名称</label>
        <div class="layui-input-block">
            <input value="" type="text" name="name" placeholder="请输入商品名称" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">上传视频</label>
        <div class="layui-input-block">
            <button type="button" class="layui-btn" id="video">
                <i class="layui-icon">&#xe67c;</i>上传视频
            </button>
        </div>
    </div>

<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label">开奖码</label>-->
<!--        <div class="layui-input-block">-->
<!--            <input type="text" name="code" placeholder="请输入开奖码" autocomplete="off" class="layui-input">-->
<!--        </div>-->
<!--    </div>-->



    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
    </div>
</form>

<script src="__ADMIN__/layuiadmin/layui/layui.js"></script>
<script type="text/javascript">
    window.HOST_TYPE='2'
</script>
<script>
    layui.config({
        base: '__ADMIN__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['form', 'upload', 'layer'], function(){
        var $ = layui.$
            ,form = layui.form
            ,upload = layui.upload
            ,layer = layui.layer;

        //执行实例
        var uploadInst = upload.render({
            elem: '#video', //绑定元素
            url: '/api/app/upload_file', //上传接口
            // data: {key: $(this).attr('data-type')},
            accept: 'video',
            done: function(res) {
                console.log(res);
                //上传完毕回调
                // $('#' + res.data.key).val(res.data.val); //将图片路径保存到表单中
                // $('.' + res.data.key).attr('src', res.data.src); //预览图片
                // // $('#uploadText').html('上传成功');
                // layer.msg(res.msg, {icon: 1});
            },
            error: function() {
                //请求异常回调
                layer.msg('上传失败', {icon: 2});
            }
        });
    })
</script>
{include file="public/footer"}